package net.sourceforge.krama.html;

public class HTMLA extends THTML{

	private String startWidget = "<a";
	private String endWidget = "</a>";
	private String nameWidget = " class=\"";
	private String onClick = " onclick=\"javascript:clic(";
	private String url = " href=\"";
	private String target = " target=\"";
	
	private String fonctionClick;
	
	public String getUrl() {
		return url;
	}

	public void setUrlWidget(String url) {
		this.url = ((url !=null) ? this.url+url+"\"" : "#\"");
	}

	protected void setOnClickWidget(String fonction) {
		fonctionClick = fonction;
		this.onClick = ((fonction !=null) ? this.onClick+fonction+");\"" : "");
	}

	@Override
	protected String getStartWidget() {
		// TODO Auto-generated method stub
		return startWidget+nameWidget+url+target+((fonctionClick != null) ? onClick : "")+" >";
	}

	@Override
	protected void setStartWidget(String startWidget) {
		// TODO Auto-generated method stub
		this.startWidget = startWidget;
	}

	@Override
	protected String getEndWidget() {
		// TODO Auto-generated method stub
		return endWidget;
	}

	@Override
	protected void setEndWidget(String endWidget) {
		// TODO Auto-generated method stub
		this.endWidget = endWidget;
	}

	@Override
	protected String getNameWidget() {
		// TODO Auto-generated method stub
		return nameWidget;
	}

	@Override
	protected void setNameWidget(String nameWidget) {
		this.nameWidget = ((nameWidget !=null) ? this.nameWidget+nameWidget+"\"" : "");
	}

	public void setTargetWidget(String target) {
		this.target = ((target !=null) ? this.target+target+"\"" : "");
	}
}
